import java.util.Scanner;

/**
 * @author gao
 * @date 2025/8/9 11:08
 */

public class Solution {
    public static int countWords(String s) {
        // 将字符串以空格分成多个字符串
        String[] words = s.split(" ");
        return words.length;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            String s = in.nextLine();
            System.out.println(countWords(s));
        }
    }
}